{% extends "ErpBundle::layout.html.twig" %}
{% block title %}{{ parent() }} - Ma Fiche{% endblock %}
{% block body %}
<ul>
  {% for u in userFiche %}
  <form method="post" id="modificationForm">
  <table class="tableEvent">
    <tr>
    	<td "tdNewUser1">
	    	<label for="telephone">Nouveau T&eacute;l&eacute;phone:</label>
	   	</td>
	   	<td "tdNewUser2">	
		    <input type="text" id="telephone" name="_telephone" />
	    </td>
	</tr>
	 <tr>
	     <td "tdNewUser1">
	     	<label for="email">Nouvel Email:</label>
	    </td>
	   	<td "tdNewUser2">	
	   	 	<input type="text" id="email" name="_email" class="required email" />
	   	 </td>
	</tr>
	 <tr>
	 	 <td "tdNewUser1">
	 		<label for="username">Nouvel Utilisateur:</label>
	 	</td>
	   	<td "tdNewUser2">	
	   	 	<input type="text" id="username" name="_username" />
	   	 </td>
	</tr>
	 <tr>
	 	 <td "tdNewUser1">
	 	 	<label for="password">Nouveau Mot de Passe:</label>
	 	</td>
	   	<td "tdNewUser2">	
	    	<input type="password" id="password" name="_password" />
		 </td>
	</tr>
	<tr>
		 <td "tdNewUser1">
			<label for="confirm_password">Confirmez votre mot de passe:</label>
		 </td>
	   	 <td "tdNewUser2">	
	    	<input type="password" id="confirm_password" name="_confirm_password" />
		 </td>
	</tr>
  {% endfor %}
   <td "tdNewUser1"></td> <td "tdNewUser2"><button type="submit" class="buttonEvent"><img src="{{ asset('bundles/erp/images/valider.png') }}"/></button></td>
  </table>
  </form>
</ul>
<a href="{{ asset('app_dev.php/erp/afficher_fiche') }}"><img src="{{ asset('bundles/erp/images/button-9240.png') }}" /></a>
<script>
	$(document).ready(function(){
   		 $("#modificationForm").validate({
   			 rules: {
   				 _telephone: {
      	   		  required: false,
      	   		  rangelength: [10, 10],
      	   		  number: true
      	   		    },
   	   		    _email: {
   	   		      required: false,
   	   		      email: true
   	   		    },
   				_username: {
	   		      required: false,
	   		      rangelength: [3, 20]
	   		    },
   			    _password: {
	   		      required: false,
	   		  	  rangelength: [5, 20]
	   		    },
		   		_confirm_password: {
			   	  required: function(element) {
			          return $("#password").val() != "";
			      },
			      equalTo: "#password",
		   		  rangelength: [5, 20]
	   		    }
   			 }
   		 });
  	});
</script>
{% endblock %}
